class face : public plane
{
public:
vector *vert[3];
vector edgenormal[3];
vector vertnormal[3];
vector color;
int texpic;
int lm;
float uv[3][2];
float lmuv[3][2];
float emmradius;
int lastdraw;
int indx;
int ray_intersect(vector& ro,vector& rd,vector& ip,float&
dist,float rad=0.0f);
void inverse_map(vector& p,float& u,float& v);
void forward_map(float& u,float& v,vector& p);
};
Member | Type | Description |
---|---|---|
vert | vector*[3] | pointer to the three face vertices |
edgenormal | vector[3] | the three edge normals |
vertnormal | vector[3] | the three vertex normals |
color | vector | the face color (r,g,b,a) |
texpic | int | the face texture picture |
lm | int | the face light map |
uv | float[3][2] | the three vertex texture co-ordinates |
lmuv | float[3][2] | the three vertex light map texture co-ordinates |
emmradius | float | the face emmisive radius (if self illuminated) |
lastdraw | int | the last frame in which the face was drawn |
indx | int | the face index into the faces array |
ray_intersect, inverse_map, forward_map
This class implements a 3D face with three vertices. Texture and light map can be applied to the face and functions for collision detection are also implemented.
If emmradius is >0, the face will cast light when static level light computation is calculated.